package chapter6.e19;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;

public class e19 {
    public static void main(String[] args) {
        TreeMap map = new TreeMap();
        map.put(3,"李四" );
        map.put(2,"王五" );
        map.put(4,"赵六" );
        map.put(3,"张三" );
        //导出key队列（map有key队列和value队列）
        Set ks = map.keySet();
        //获取到TreeSet以后 排序显示
        Iterator it = ks.iterator();
        while (it.hasNext()) {
            Object key = it.next();
            System.out.println(key + ":" + map.get(key));
        }
    }
}
